/****************************************************
          File Name:svshm_xfr.h
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Tue 16 Sep 2014 07:36:24 PM CST
*****************************************************/

#include<sys/types.h>
#include<sys/stat.h>
#include<sys/shm.h>
#include<errno.h>
#include<stdbool.h>     // _Bool 
#include<unistd.h>
#include<stdlib.h>
#include<stdio.h>

#define SHM_KEY 0x1309

#define OBJ_PERMS (S_IRUSR|S_IWUSR|S_IWGRP|S_IRGRP)

#ifndef BUF_SIZE
#define BUF_SIZE 1024
#endif

struct shmseg{
    int cnt;
    char buf[BUF_SIZE];
    _Bool status;        /* EVENT MARK */
    _Bool exit;         /* reader exit or not */
};

void err(char *fun)
{
    perror(fun);
    exit(errno);
}
